package com.lzxuni;

import com.lzxuni.datasources.DynamicDataSourceConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Import;

/**
 * LzxAdminApplication
 *
 * @author liuzp
 * @version 1.0
 * @createTime 2019-06-21 10:50
 * @description 后台启动类
 **/
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class, SecurityAutoConfiguration.class})
@MapperScan(basePackages = {"com.lzxuni.modules.*.mapper"})
@Import({DynamicDataSourceConfig.class})
@EnableFeignClients(basePackages= {"com.lzxuni"})
@ServletComponentScan
public class LzxAdminApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(LzxAdminApplication.class, args);
    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(LzxAdminApplication.class);
    }
}
